bitkeeper revision 1.529 (3f8fc2fe0B2d6C1J6fAamzO9FAybWA)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Fri, 17 Oct 2003 10:22:54 +0000 (10:22 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Fri, 17 Oct 2003 10:22:54 +0000 (10:22 +0000)
Add some error checking to xen-clone

tools/misc/xen-clone

index 07a918113d6742819ab0e51c49813d63a0961e69..06aba1d815ae90edf0970023e35245f55b67b0bb 100755 (executable)
@@ -60,7 +60,13 @@ cd ${TOP}
 fi
 
 # identify this version of linux
-LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/xenolinux-sparse || /bin/ls -ld xenolinux-*-sparse ) 2>/dev/null | sed -e 's!^.*xenolinux-\([0-9.]\+\)-sparse!\1!'`
+LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/xenolinux-sparse || /bin/ls -ld ${DEST_BK_REP}/xenolinux-*-sparse ) 2>/dev/null | sed -e 's!^.*xenolinux-\(.\+\)-sparse!\1!'`
+
+if [ -z "${LINUX_VER}" ]
+then
+echo Unable to identify Linux version. Bailing.
+exit -1
+fi
 
 # copy in the master Linux tree for this kernel
 if [ ! -d linux-${LINUX_VER} ]